<?php $this->load->view('common/head');?>
<form class="form-horizontal" name="add" id="add" action="<?php echo $this->input->server('REQUEST_URI'); ?>" method="post">
<input type="hidden" name="id" id="id" value="<?=isset($timeUnitData) ? $timeUnitData['id'] : ''?>">
  <div class="form-group">
    <label class="col-sm-2 control-label" for="year">年份</label>
    <div class="col-sm-4">
    <input type="input" class="form-control" name="year" id="year" value="<?=isset($timeUnitData) ? $timeUnitData['year'] : date("Y")?>" placeholder="年份">
    </div>
  </div>
  <div class="form-group">
    <label class="col-sm-2 control-label" for="name">时段名称</label>
    <div class="col-sm-4">
    <input type="input" class="form-control" name="name" id="name" value="<?=isset($timeUnitData) ? $timeUnitData['name'] : ''?>" placeholder="时段名称">
    </div>
  </div>
  <div class="form-group">
    <label class="col-sm-2 control-label" for="orderNum">排序数字</label>
    <div class="col-sm-4">
    <input type="input" class="form-control" name="orderNum" id="orderNum" value="<?=isset($timeUnitData) ? $timeUnitData['orderNum'] : 0?>" placeholder="排序数字">
    <p class="help-block">数字越小越靠前，数字越大越靠后。</p>
    </div>
  </div>
  <div class="form-group">
    <label class="col-sm-2 control-label" for="startTime">时段时间范围</label>
    <div class="input-group">
    <input type="input" class="form-control" name="startTime" id="startTime" value="<?=isset($timeUnitData) ? $timeUnitData['startTime'] : ''?>" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss', maxDate:'#F{$dp.$D(\'endTime\')}' })" placeholder="开始时间">
    <div class="input-group-addon">~</div>
    <input type="input" class="form-control" name="endTime" id="endTime" value="<?=isset($timeUnitData) ? $timeUnitData['endTime'] : ''?>" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'startTime\')}' })" placeholder="结束时间">
    </div>
  </div>
  <hr>
  <div class="form-group">
    <label class="col-sm-2 control-label" for="weekNum">所含周数</label>
    <div class="col-sm-4">
    <input type="input" class="form-control" name="weekNum" id="weekNum" value="<?=isset($timeUnitData) ? $timeUnitData['weekNum'] : 0?>" placeholder="周数">
    <p class="help-block"></p>
    </div>
  </div>
  <div class="form-group text-center">
	<div class="col-sm-4">
	  <button type="button" onclick="ajaxFormSubmit('add')" class="btn btn-default btn-primary">保存</button>
	  <button type="button" onclick="closeWindow()" class="btn btn-default btn-primary">取消</button>
	</div>
  </div>
</form>
<?php $this->load->view('common/foot');?>